<%@ page import="com.neuedu.entity.Dept" %>
<%@ page import="java.util.List" %>

<%@ page contentType="text/html;charset=UTF-8" language="java" %>


<html>
<head>
    <title>Title</title>
</head>
<body>


<h3>	MVC架构1 </h3>
<%
	//获取Controller中的 request数据
	List<Dept> depts = (List<Dept>) request.getAttribute("deptList");

    %>


      <a href="<%=request.getContextPath()%>/business/dept/dept_add.jsp">部门添加</a>
       <table border="1" width="500px"  cellpadding="0" cellspacing="0">
           	<tr align="center">                                                  
               		<td>部门id</td>                                                      
               		<td>部门名称</td>                                                      
               		<td>办公地址</td>                                                      
               		<td>操作</td>                                                      
               	</tr>                                                                  

      <%
			String contextPath = request.getContextPath();
			for (int i = 0; i < depts.size(); i++) {
			Dept dept = depts.get(i);
		  %>
           	<tr align="center">
               		<td> <%= dept.getDeptno()%> </td>
               		<td> <%= dept.getDname()%> </td>
               		<td> <%= dept.getLoc()%> </td>

               		<td>               
                   		  <a href='<%=request.getContextPath()%>/dept?_type=toEdit&deptno=<%=dept.getDeptno()%>'>修改</a>   &nbsp;&nbsp;&nbsp;&nbsp;
                   		  <a href='<%=request.getContextPath()%>/dept?_type=deleteById&deptno=<%=dept.getDeptno()%>'>删除</a>   &nbsp;&nbsp;&nbsp;&nbsp;
                   	   </td>
               	</tr>
		   <%}%></table>



</body>
</html>
